﻿using Newtonsoft.Json;

namespace PDFDesign.Model
{
    public class NewStyle
    {
        [JsonProperty("pageSetting")]
        public Pagesetting PageSetting { get; set; }
        [JsonProperty("controls")]
        public Control[] Controls { get; set; }
        [JsonProperty("table")]
        public Table Table { get; set; }
    }

    public class Pagesetting
    {
        [JsonProperty("size")]
        public float[] Size { get; set; }
        [JsonProperty("layout")]
        public string Layout { get; set; }
        [JsonProperty("margins")]
        public Margins Margins { get; set; }
        [JsonProperty("reportCount")]
        public int ReportCount { get; set; }
    }

    public class Margins
    {
        [JsonProperty("top")]
        public int Top { get; set; }
        [JsonProperty("left")]
        public int Left { get; set; }
        [JsonProperty("bottom")]
        public int Bottom { get; set; }
        [JsonProperty("right")]
        public int Right { get; set; }
    }

    public class Table
    {
        [JsonProperty("fixedRowCount")]
        public bool FixedRowCount { get; set; }
        [JsonProperty("rowCount")]
        public int RowCount { get; set; }
        [JsonProperty("renderWhiteRow")]
        public bool RenderWhiteRow { get; set; }
        [JsonProperty("position")]
        public Position Position { get; set; }
        [JsonProperty("size")]
        public Size Size { get; set; }
        [JsonProperty("fixedRows")]
        public Row[] FixedRows { get; set; }
        [JsonProperty("columns")]
        public Column[] Columns { get; set; }
        [JsonProperty("rows")]
        public Row[] Rows { get; set; }
    }

    public class Position
    {
        [JsonProperty("top")]
        public int Top { get; set; }
        [JsonProperty("left")]
        public int Left { get; set; }
    }

    public class Size
    {
        [JsonProperty("width")]
        public int Width { get; set; }
        [JsonProperty("height")]
        public int Height { get; set; }
    }

    public class Cell
    {
        [JsonProperty("name")]
        public string Name { get; set; }
        [JsonProperty("origin")]
        public string Origin { get; set; }
        [JsonProperty("value")]
        public string Value { get; set; }
        [JsonProperty("columnSpan")]
        public int ColumnSpan { get; set; }
        [JsonProperty("textStyle")]
        public Textstyle TextStyle { get; set; }
    }

    public class Textstyle
    {
        [JsonProperty("font")]
        public Font Font { get; set; }
        [JsonProperty("align")]
        public string Align { get; set; }
        [JsonProperty("valign")]
        public string Valign { get; set; }
        [JsonProperty("margins")]
        public Margins Margins { get; set; }
    }

    public class Font
    {
        [JsonProperty("name")]
        public string Name { get; set; }
        [JsonProperty("size")]
        public int Size { get; set; }
    }

    public class Column
    {
        [JsonProperty("name")]
        public string Name { get; set; }
        [JsonProperty("fixedWidth")]
        public bool FixedWidth { get; set; }
        [JsonProperty("precent")]
        public int Precent { get; set; }
    }

    public class Row
    {
        [JsonProperty("type")]
        public string Type { get; set; }
        [JsonProperty("multHeader")]
        public bool MultHeader { get; set; }
        [JsonProperty("fixedRowHeight")]
        public bool FixedRowHeight { get; set; }
        [JsonProperty("height")]
        public int Height { get; set; }
        [JsonProperty("cells")]
        public dynamic[] Cells { get; set; }
    }

    public class Control
    {
        [JsonProperty("type")]
        public string Type { get; set; }
        [JsonProperty("name")]
        public string Name { get; set; }
        [JsonProperty("caption")]
        public string Caption { get; set; }
        [JsonProperty("showCaption")]
        public bool ShowCaption { get; set; }
        [JsonProperty("origin")]
        public string Origin { get; set; }
        [JsonProperty("dataField")]
        public string DataField { get; set; }
        [JsonProperty("isPageNumber")]
        public bool IsPageNumber { get; set; }
        [JsonProperty("value")]
        public string Value { get; set; }
        [JsonProperty("relativeTable")]
        public bool RelativeTable { get; set; }
        [JsonProperty("position")]
        public Position Position { get; set; }
        [JsonProperty("size")]
        public Size Size { get; set; }
        [JsonProperty("textStyle")]
        public Textstyle TextStyle { get; set; }
    }

}
